package cn.yunbamboos.mybatis.mapping.methods.generate;

import cn.yunbamboos.mybatis.metadata.TableInfo;
import org.apache.ibatis.builder.StaticSqlSource;
import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.session.Configuration;

public class GenerateIdForStringMethod extends GenerateIdMethod {

    public GenerateIdForStringMethod(Configuration configuration, TableInfo tableInfo) {
        super("generateId", configuration, tableInfo);
    }

    @Override
    protected SqlSource getSqlSource() {
        return new StaticSqlSource(configuration, "select uuid() ");
    }

    @Override
    protected Class<?> getResultClass() {
        return String.class;
    }
}